<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2021/11/16
  Time: 10:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath();%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />

    <link rel="stylesheet" href="<%=path %>/web/index/css/font.css">
    <link rel="stylesheet" href="<%=path %>/web/index/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="<%=path %>/web/index/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="<%=path %>/web/index/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="<%=path%>/web/jquery-1.3.1.js"></script>
    <script type="text/javascript">
        function check_form(){
            var loginname = document.getElementById("loginname").value;
            var password = document.getElementById("password").value;
            var username = document.getElementById("username").value;

            if(loginname==""){
                alert("系统提示：填写不规范（登录账号不能为空 不能为空！请检查……）");
                return false;
            }
            if(password==""){
                alert("系统提示：填写不规范（登录密码 不能为空！请检查……）");
                return false;
            }
            if(username==""){
                alert("系统提示：填写不规范（真实姓名 不能为空！请检查……）");
                return false;
            }
        }
        function returnfor(){
            window.location.href = "tab_users_view";
        }

        function check_msg(){
            var msg = '${b}';
            if(msg=="true"){
                alert("系统提示：创建数据成功！即将返回列表……");
                returnfor();
            }if(msg=="false"){
                alert("系统提示：创建数据失败！请检查……");
            }
        }

        function do_username(){
            var username = document.getElementById("username").value;
            $.ajax({
                type : "post",
                url : "do_username_ajax",
                data : {
                    username:username
                },
                dataType : "text",
                success : function(data) {
                    document.getElementById("loginname").value = data;
                },
                error : function() {
                    alert('系统提示：出现异常，请稍后重试！');
                }
            });

        }



        function check(e) {
            var re = /^\d+(?=\.{0,1}\d+$|$)/
            if (e.value != "") {
                if (!re.test(e.value)) {
                    alert("请输入正确的数字");
                    e.value = "";
                    e.focus();
                }
            }
        }

    </script>




</head>

<body onload="check_msg()">
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">员工信息管理</a>
        <a>
          <cite>员工充值</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <h1 ><strong style="font-size: 25px;">【${u.username}】充值面板</strong></h1>
    <form action="/tab_users_acc_up_money" method="post" onsubmit="return check_form()">


        <table class="layui-table">

            <tr>
                <th style="text-align: right;">真实姓名：</th>
                <td style="width: 200px;">${u.username }</td>
                <td style="color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
            </tr>


            <tr>
                <th style="text-align: right;">年龄：</th>
                <td style="width: 200px;">${u.age }</td>
                <td style="color: red;"></td>
            </tr>

            <tr>
                <th style="text-align: right;">性别：</th>
                <td style="width: 200px;">
                    ${u.sex }
                </td>
                <td style="color: red;"></td>
            </tr>

            <tr>
                <th style="text-align: right;">联系方式：</th>
                <td style="width: 200px;"> ${u.tel }</td>
                <td style="color: red;"></td>
            </tr>

            <tr>
                <th style="text-align: right;">Email：</th>
                <td style="width: 200px;"> ${u.email }</td>
                <td style="color: red;"></td>
            </tr>

            <tr>
                <th style="text-align: right;">当前余额：</th>
                <td style="width: 200px;"> <strong style="color: darkred;font-size: 30px;">${acc.monnum }</strong></td>
                <td style="color: red;"></td>
            </tr>

            <tr>
                <th style="text-align: right;">充值金额：</th>
                <td style="width: 200px;"><input type="text" name="monnum" id="monnum"  autocomplete="off"  class="layui-input" onblur="check(this)"  onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')"/></td>
                <td style="color: red;"></td>
            </tr>
            <input type="hidden" name="usersid" value="${u.id}" />
            <input type="hidden" name="accid" value="${acc.id}" />
            <input type="hidden" name="pmonnum" value="${acc.monnum}" />


            <tr>
                <td colspan="3" style="text-align: center;">
                    <button class="layui-btn"  lay-submit="" lay-filter="sreach" type="submit"> 充 值 </button>
                    <button onclick="returnfor()" class="layui-btn"  lay-submit="" lay-filter="sreach" type="button" style="background-color: indianred;"> 返 回 </button>
                </td>
            </tr>

        </table>
    </form>
</div>

</body>

</html>
